using System;
using System.Windows;

namespace FluentSilverlight.Expressions
{
    public class TextAlignmentExpression<TParentPart>
    {
        private readonly TParentPart parentPart;
        private readonly Action<TextAlignment> setValue;

        public TextAlignmentExpression(TParentPart parentPart, Action<TextAlignment> setValue)
        {
            this.parentPart = parentPart;
            this.setValue = setValue;
        }

        public TParentPart Center()
        {
            setValue(TextAlignment.Center);
            return parentPart;
        }

        public TParentPart Left()
        {
            setValue(TextAlignment.Left);
            return parentPart;
        }

        public TParentPart Right()
        {
            setValue(TextAlignment.Right);
            return parentPart;
        }
    }
}